package com.wv.utils;

import cn.hutool.core.util.RandomUtil;
import org.springframework.util.DigestUtils;

import java.util.Random;

public class MD5EncryptionUtil {

    public static String EncodeByMd5(String password,String slat){
        byte[] bytes = (password + slat).getBytes();
        return DigestUtils.md5DigestAsHex(bytes);
    }

    public static String RandomSalt(){
        return RandomUtil.randomString(4);
    }

    public static void main(String[] args) {
        System.out.println(EncodeByMd5("123456", "hds"));
    }

}
